// import { ElMessageBox } from 'element-plus'

export default (text = '', options = {}) => {
  return new Promise((resolve) => {
    ElMessageBox.confirm(text ? text : '是否执行操作?', '', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
      ...options
    })
      .then(() => {
        resolve(true)
      })
      .catch(() => {
        resolve(false)
      })
  })
}
